<?php

namespace addons\booking\model;

use think\Model;

class HouseMode extends Model
{

    // 表名
    protected $name = 'house_mode';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [];

    public static function get_room_model($store_id = 0)
    {
        $where['store_id'] = $store_id;
        $where['status'] = 1;
        $list =  collection(self::where($where)->field('id,name')->order('weigh')->select())->toArray();
        return $list ? $list : [];
    }
}
